import json from '@rollup/plugin-json'
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import sass from 'rollup-plugin-sass'

const tsconfigOverride = {
	compilerOptions: { declaration: true },
	exclude: [
		'src/**/*.test.tsx',
		'src/**/*.stories.tsx',
		'src/**/*.stories.ts',
		'src/**/*.mdx',
		'example'
	]
}

const config = {
	input: 'src/index.ts',
	plugins: [
		nodeResolve(),
		commonjs(),
		json(),
		typescript({
			tsconfigOverride
		}),
		sass({ output: 'dist/index.css' })
	]
}

export default config
